import request from "@/utils/request";
// 住户信息
// 获取住户信息
export default {
  getRest(_id){
    return request({
      url:`/rest/listone?_id=${_id}`,
      method:"get"
    })
  },
  // 获取住户
  getRestList(page, size, serach) {
    return request({
      url: "/rest/list",
      method: "post",
      data: {
        page,
        size,
        serach,
      },
    });
  },
  // 删除住户
  deleteRestlist(_id) {
    return request({
      url: "/rest/delete",
      method: "delete",
      data: {
        _id,
      },
    });
  },
  // 添加住户
  addRest(rest) {
    return request({
      url: "/rest/add",
      method: "post",
      data: rest ,
    });
  },
  // 删除图片
  restDeleteImg(name) {
    return request({
      url: "/img/delete",
      method: "post",
      data: {
        name,
      },
    });
  },
  // 更新图片
  update(rest){
    return request({
      url:'/rest/update',
      method:"post",
      data:rest
    })
  }
};
